package methodOnde;

import java.util.Scanner;

public class Subtring {
    public static void main(String[] args) {
        System.out.println("请输入手机号：");
        Scanner s = new Scanner(System.in);
        String phone=s.nextLine();
        for(int i=0;i<phone.length();i++){
            System.out.println(phone.charAt(i));
        }
        System.out.println(phone.substring(0,3)+"****"+phone.substring(7,11));
        String newPhone=  phone.replace(phone.substring(3,7),"****");
        System.out.println(newPhone);
    }
}
